package org.keyroy.map_editor.core.map_tile;

import java.awt.Image;
import java.util.Properties;

public class Tile implements Cloneable {
	protected Properties properties;
	protected boolean isMoveable;
	protected Image image;
	protected int ID;

	public Tile() {
	}

	public Tile(Image image) {
		this.image = image;
	}

	public final void setID(int iD) {
		ID = iD;
	}

	public final int getID() {
		return ID;
	}

	public final boolean isMoveable() {
		return isMoveable;
	}

	public final void setMoveable(boolean isMoveable) {
		this.isMoveable = isMoveable;
	}

	public final void setImage(Image image) {
		this.image = image;
	}

	public final Image getImage() {
		return image;
	}

	public void addProperty(String key, String value) {
		if (properties == null) {
			properties = new Properties();
		}
		properties.put(key, value);
	}

	public final Properties getProperties() {
		return properties;
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		Tile tile = new Tile();
		tile.properties = this.properties;
		tile.image = this.image;
		tile.isMoveable = this.isMoveable;
		return tile;
	}

}
